package ImgCombine;
import java.util.ArrayList;
import java.util.List;
import XmlLoader.Position;

public class ObjListStore 
{
	public List<ObjImgInfo> list_objImgInfo = new ArrayList<ObjImgInfo>();
	public void ACT001_addObjImgInfo(int time, int objNo, int objPointNo, Position pos)
	{
		ObjImgInfo obj = new ObjImgInfo(time, objNo, objPointNo, pos);
		//find inserted position
		int insertedPos = 0;
		boolean isFound = false;
		while(!isFound && insertedPos < list_objImgInfo.size())
		{
			if(time < list_objImgInfo.get(insertedPos).time)  //find inserted target
			{
				isFound = true;
			}
			else  //not find inserted target, turn next 
			{
			    insertedPos = insertedPos + 1;
			}
		}
		//insert object to list
		list_objImgInfo.add(insertedPos, obj);
	}
	public void ACT002_showTable()
	{
		int index = 0;
		while(index < this.list_objImgInfo.size())
		{
			System.out.println(this.list_objImgInfo.get(index).toString());
			index = index + 1;
		}
	}
	public ObjImgInfo GET001_elementIn_list_objImgInfo(int index)
	{
		return this.list_objImgInfo.get(index);
	}
	public int GET002_totalNumOf_list_objImgInfo()
	{
		return this.list_objImgInfo.size();
	}
}